<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // rest参数,以对象形式存储剩余参数
    function connect({host,port,...user}){
      console.log(host);
      console.log(port);
      console.log(user);
    }

    connect({
      host:'127.0.0.1',
      port:3306,
      username:'张三',
      password:'123456'
    })

    // 扩展运算符 对象的合并
    const skill1={q:'天音波'}
    const skill2={w:'金钟罩'}
    const mangsen={...skill1,...skill2}
    console.log(mangsen);
  </script>
</body>
</html>